home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / sound / sndplaydoublebuffer / _headers / simpleapp_sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.4 KB  |  66 lines

  1. /*
  2.     File:        SimpleApp_Sound.h
  3.  
  4.     Contains:    Header for SimpleQT functions using SimpleApp framework.
  5.  
  6.     Written by: Mark Cookson    
  7.  
  8.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/31/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. #include    <Windows.h>
  25.  
  26. #include    "SAL_Public.h"
  27. #include    "DBFF.h"
  28.  
  29. #define    oneBuffer                (1)
  30. #define    tenBuffers                (10)
  31. #define    soundPlaying            (!ASoundIsDone (mySoundInfo) && !paused)
  32. #define    qtStyle                    0
  33. #define    cdStyle                    1
  34. #define kScrollMinValue            1
  35.  
  36. /* Globals */
  37. ControlHandle            startButton        = nil,
  38.                         stopButton        = nil,
  39.                         resumeButton    = nil,
  40.                         scrollBar        = nil,
  41.                         checkBox        = nil;
  42. Boolean                    CDStyle            = false,        /* false means QuickTime style scrolling */
  43.                         gPlayBackwards    = false,        /* should we play backwards? */
  44.                         paused            = false,        /* are we currently paused? */
  45.                         stopped            = false,        /* are we currently stopped? */
  46.                         gDone            = false;
  47. SoundInfoPtr            mySoundInfo        = nil;
  48. GrafPtr                    gTheWindow        = nil;
  49. Str255                    gOldWindowTitle;
  50.  
  51. /* Function declarations */
  52. extern pascal    void    DoScroll        (ControlHandle control, short part);
  53. extern pascal    void    MyScrollAction    (ControlHandle control, short part);
  54. extern pascal OSErr    DoPlay (const ButtonItemRef pButtonItemRef,const long modifiers);
  55. extern pascal OSErr DoPause(const ButtonItemRef pButtonItemRef,const long modifiers);
  56.         void    MyIdleProc        (EventRecord *evt);
  57. extern pascal OSErr    DoStop(const ButtonItemRef pButtonItemRef,const long modifiers);
  58. extern pascal    short    DoPostGroupHit    (long  modifiers,
  59.                                 ControlRef theControl,
  60.                                 ButtonItemRef brh,
  61.                                 short item);
  62. pascal short DoPlayBackwards(const ButtonItemRef pButtonItemRef,const long modifiers);
  63.         void    main            (void);
  64.         void    EnableControl    (ControlRef cr);
  65.         void     DisableControl    (ControlRef cr);
  66.